package com.weibiao.zhuhai.algorithm.util;

public class Andyutil {
	public static void swap(int[] a, int p, int q) {
		int temp = a[p];
		a[p] = a[q];
		a[q] = temp;
	}

	public static void printPrimitiveArray(int[] a, int begin, int end, char splitChar) {
		boolean firstTime = true;
		for (int i = begin; i <= end; i++) {
			System.out.print(new StringBuilder().append((firstTime == true) ? "" : splitChar).append(a[i]).toString());
			firstTime = false;
		}
	}
}
